package com.ws.hzuoj.admin.system.genetration.service.impl;

import com.ws.common.easyui.util.Page;
import com.github.pagehelper.PageHelper;
import com.ws.hzuoj.admin.system.genetration.dao.GenerationConfigMapper;
import com.ws.hzuoj.admin.system.genetration.entity.GenerationConfig;
import com.ws.hzuoj.admin.system.genetration.service.IGenerationConfigService;
import com.ws.common.base.service.Impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GenerationConfigServiceImpl extends BaseServiceImpl<GenerationConfig> implements IGenerationConfigService{

	@Autowired
	GenerationConfigMapper generationConfigMapper;

	@Override
	public List<GenerationConfig> list(GenerationConfig params) {
		return generationConfigMapper.list(params);
	}

	@Override
	public List<GenerationConfig> list(GenerationConfig params, Page page) {
		PageHelper.startPage(page.getPage(),page.getRows(),page.getSortOrder());
		return generationConfigMapper.list(params);
	}

	@Override
	public Integer save(GenerationConfig generationConfig) {
		return this.insertOrUpdate(generationConfig);
	}
}
